<?php

/*
    Author: Mike
    Date:2013/08/22
*/

define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');

if(isset($_POST['delete_bonus_id']))
{
    $bonus_id=$_POST['delete_bonus_id'];
    if($bonus_id!='')
    {
        $db->query("DELETE from" .$GLOBALS['ecs']->table('user_bonus'). " WHERE bonus_id in ($bonus_id)");
        echo "删除成功";
    }
    else {
        echo "删除出错！";
    }
}

if(isset($_POST['stop_bonus_id']))
{
    $bonus_id=$_POST['stop_bonus_id'];
    if($bonus_id!='')
    {
        $db->query("update" .$GLOBALS['ecs']->table('user_bonus'). " set is_confirmed='0' WHERE bonus_id in ($bonus_id)");
        echo "停用成功";
    }
    else {
        echo "停用出错！";
    }
}

if(isset($_POST['using_bonus_id']))
{
    $bonus_id=$_POST['using_bonus_id'];
    if($bonus_id!='')
    {
        $db->query("update" .$GLOBALS['ecs']->table('user_bonus'). " set is_confirmed='1' WHERE bonus_id in ($bonus_id)");
        echo "启用成功";
    }
    else {
        echo "启用出错！";
    }
}
?>